home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / Clock / Sources / Frame.h < prev    next >
Encoding:
Text File  |  1996-09-17  |  3.4 KB  |  111 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                Frame.h
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FRAME_H
  11. #define FRAME_H
  12.  
  13. #ifndef FWFRAME_H
  14. #include "FWFrame.h"
  15. #endif
  16.  
  17. #ifndef FWSTRING_H
  18. #include "FWString.h"
  19. #endif
  20.  
  21. #ifndef FWCOLOR_H
  22. #include "FWColor.h"
  23. #endif
  24.  
  25. #ifndef FWRECT_H
  26. #include "FWRect.h"
  27. #endif
  28.  
  29. #ifndef FWMAPING_H
  30. #include "FWMaping.h"
  31. #endif
  32.  
  33. //========================================================================================
  34. // Classes used by this interface
  35. //========================================================================================
  36.  
  37. class FW_CTime;
  38. class CClockPart;
  39. class CClockContent;
  40. class FW_CGraphicContext;
  41. class CClockView;
  42.  
  43. //========================================================================================
  44. //    Defines
  45. //========================================================================================
  46.  
  47. #define kBackgroundColorProp        "Apple:Framework:Property:BackgroundColor"
  48. #define kBackgroundColorValue        "Apple:Framework:Value:BackgroundColor"
  49.  
  50. //========================================================================================
  51. // CClockFrame
  52. //========================================================================================
  53.  
  54. class CClockFrame : public FW_CFrame
  55. {
  56. public:
  57.     FW_DECLARE_AUTO(CClockFrame)
  58.  
  59. //----------------------------------------------------------------------------------------
  60. //    Constructor/Destructor
  61. //
  62. public:
  63.     CClockFrame(Environment* ev, ODFrame* odFrame, FW_CPresentation* presentation, CClockPart* clockPart, CClockContent* content);
  64.     virtual ~ CClockFrame();
  65.  
  66. //----------------------------------------------------------------------------------------
  67. //    Inherited API
  68. //
  69. public:
  70.     virtual void        Draw(Environment* ev, ODFacet* odFacet, ODShape* invalidShape);
  71.     virtual void         FacetAdded(Environment* ev, ODFacet* facet, unsigned short facetCount);
  72.     
  73.     virtual ODShape*    AdjustUsedShape(Environment* ev, ODShape* suggestedUsedShape);
  74.     virtual ODShape*    AdjustActiveShape(Environment* ev, ODFacet* facet, ODShape* suggestedActiveShape);
  75.  
  76.     virtual void        PresentationChanged(Environment* ev);
  77.  
  78.     virtual FW_Handled    DoAdjustMenus(Environment* ev, FW_CMenuBar* menuBar, FW_Boolean hasMenuFocus, FW_Boolean isRoot);
  79.     virtual FW_Handled    DoMenu(Environment* ev, const FW_CMenuEvent& theMenuEvent);
  80.         
  81. //----------------------------------------------------------------------------------------
  82. //    New API
  83. //
  84. public:
  85.     CClockView*            GetClockView(Environment* ev) const;
  86.     CClockContent*        GetClockContent(Environment* ev) const;
  87.     
  88.     void                SetBackgroundColor(Environment* ev, FW_CColor& newColor);
  89.     void                GetBackgroundColor(FW_CColor* newColor) const;
  90. private:    
  91.     virtual void        AdoptContainingPartProperties(Environment* ev, ODStorageUnit* propertyUnit);
  92.     
  93. //----------------------------------------------------------------------------------------
  94. //    Data Members
  95. //
  96. private:
  97.     CClockPart*         fClockPart;
  98.     FW_CColor            fBackgroundColor;
  99.     CClockContent*        fClockContent;
  100. };
  101.  
  102. //----------------------------------------------------------------------------------------
  103. //    CClockFrame::GetClockContent
  104. //----------------------------------------------------------------------------------------
  105. inline CClockContent* CClockFrame::GetClockContent(Environment*) const
  106. {
  107.     return fClockContent;
  108. }
  109.  
  110. #endif
  111.